import request from '@/utils/request'

// 启动新流程实例
export function startProcess(procDefId, data) {
  return request({
    url: '/flowable/task/start/' + procDefId,
    method: 'post',
    data: data
  })
}
// 我的发起的流程
export function myProcessList(query) {
  return request({
    url: '/flowable/task/myProcess',
    method: 'get',
    params: query
  })
}
// 流程列表
export function processList(query) {
  return request({
    url: '/flowable/task/process',
    method: 'get',
    params: query
  })
}
// 终止流程
export function stopProcess(data) {
  return request({
    url: '/flowable/task/stopProcess',
    method: 'post',
    data: data
  })
}

// 删除流程实例
export function deleteProcess(data) {
  return request({
    url: '/flowable/instance/deleteProcess',
    method: 'post',
    data: data
  })
}


// 获取流程变量
export function getProcessVariables(taskId) {
  return request({
    url: '/flowable/task/processVariables/' + taskId,
    method: 'get'
  })
}



// 读取image文件
export function getFlowViewer(procInsId, executionId) {
  return request({
    url: '/flowable/task/flowViewer/' + procInsId + '/' + executionId,
    method: 'get'
  })
}
